Skip to content

Conversation

avivkeller
Copy link
Member

Follow-up #8057.

Now that we have a basic package, this PR modifies the rules to use @nodejs/doc-kit's functionality, ensuring that any changes their get reflected in the linter.

Why was this separate from #8057? I wanted a version (1.0.0) which is almost a drop-in replacement for the original linter, without relying on @nodejs/doc-kit, in case something broke.

@avivkeller avivkeller requested review from a team as code owners August 22, 2025 23:32
Copy link

vercel bot commented Aug 22, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Updated (UTC)
nodejs-org Ready Ready Preview Sep 30, 2025 7:58pm

Copy link

codecov bot commented Aug 22, 2025

Codecov Report

❌ Patch coverage is 95.86777% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 76.78%. Comparing base (85a3788) to head (66398ed).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...emark-lint/src/rules/duplicate-stability-nodes.mjs 83.87% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8106      +/-   ##
==========================================
+ Coverage   76.61%   76.78%   +0.16%     
==========================================
  Files         115      117       +2     
  Lines        9610     9696      +86     
  Branches      322      334      +12     
==========================================
+ Hits         7363     7445      +82     
- Misses       2246     2250       +4     
  Partials        1        1              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@avivkeller
Copy link
Member Author

@nodejs/web what other lint rules are needed?

I'm thinking:

  • Typed lists syntax
  • Stability node syntax
  • Alphabetical typed headings

What else?

Copy link
Member

@ovflowd ovflowd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OOC, when we add new rules, in which repositories are they being applied? doc-kit? So it means Node's core API docs? Shouldn't then any PR to remark-lint actually require nodejs/collaborators as code owners?

@avivkeller
Copy link
Member Author

OOC, when we add new rules, in which repositories are they being applied? doc-kit? So it means Node's core API docs? Shouldn't then any PR to remark-lint actually require nodejs/collaborators as code owners?

My plan is for these to be applied to nodejs/node once the new tooling is adopted (but it is not dependent on, and could land beforehand).

The previous implementation did not have any CODEOWNERS, thus, this is the same, however, that can change

Copy link
Contributor

@Ethan-Arrowood Ethan-Arrowood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Copy link
Member

@AugustinMauroy AugustinMauroy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGMT !

@avivkeller avivkeller added the github_actions:pull-request Trigger Pull Request Checks label Aug 26, 2025
@github-actions github-actions bot removed the github_actions:pull-request Trigger Pull Request Checks label Aug 26, 2025
Copy link
Contributor

github-actions bot commented Aug 26, 2025

Lighthouse Results

URL Performance Accessibility Best Practices SEO Report
/en 🟠 82 🟢 100 🟢 100 🟢 100 🔗
/en/about 🟢 99 🟢 97 🟢 100 🟠 88 🔗
/en/about/previous-releases 🟢 97 🟢 93 🟢 100 🟠 89 🔗
/en/download 🟢 90 🟢 100 🟢 100 🟢 100 🔗
/en/blog 🟢 100 🟢 100 🟢 96 🟢 100 🔗

@avivkeller
Copy link
Member Author

avivkeller commented Sep 30, 2025

I'm going to rebase this, as there have been no objections from core collaborators

@Copilot Copilot AI review requested due to automatic review settings September 30, 2025 19:37
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds strict linting rules by integrating @nodejs/doc-kit functionality to ensure type reference validation and improve existing rules. The changes move from a basic linter implementation to one that leverages doc-kit's utilities for more comprehensive validation.

  • Adds a new invalid-type-reference rule that validates type references using doc-kit's parser utilities
  • Updates the duplicate-stability-nodes rule to use doc-kit's queries instead of hardcoded regex patterns
  • Enhances the hashed-self-reference rule to automatically fix URLs

Reviewed Changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
packages/remark-lint/src/rules/invalid-type-reference.mjs New rule that validates type references are properly formatted and valid using doc-kit utilities
packages/remark-lint/src/rules/hashed-self-reference.mjs Adds automatic URL correction to fix self-references
packages/remark-lint/src/rules/duplicate-stability-nodes.mjs Refactors to use doc-kit queries and improves duplicate detection logic
packages/remark-lint/src/rules/tests/invalid-type-reference.test.mjs Test cases for the new invalid-type-reference rule
packages/remark-lint/src/api.mjs Registers the new invalid-type-reference rule and adds 'npm' to allowed terminology
packages/remark-lint/package.json Bumps version to 1.1.0 and adds doc-kit dependency
packages/remark-lint/README.md Documents the new invalid-type-reference rule
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants